
<#include "header.ftl">
 <link rel="stylesheet" href="${Domain}common//tree-master/dist/amazeui.tree.min.css">
<script src="${Domain}common//tree-master/dist/amazeui.tree.min.js"></script>

  <!-- 内容区域 -->
<div class="tpl-content-wrapper">
 <div class="container-fluid am-cf">
                <div class="row">
                     <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li ><a href="${Domain}my/msgs/list">用户私信</a></li>
						  <li class="am-active">详情</li>
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>
  </div>
       <div class="row-content am-cf">
                <div class="row">
  
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            
                             <div class="widget-head am-cf">
                                <div class="widget-title  am-fl">${u.name}</div>
								<div class="widget-function am-fr">
                                   	 私信${page.total}条
                                </div>
                            </div>
                            
                            <div class="widget-body  am-fr">
                            
                           <div class="am-g">
							  
							
							 
							 	<!--评论框  -->
							<section class="am-g ">
							 	 
							<div class="am-panel-bd">
							<div class="am-comment">
							<a href="#">
							<img src="${Domain}${user.Avatar()}" alt="" class="am-comment-avatar"></a>
							<div class="am-comment-main">
							<form method="post" class="am-form" action="${Domain}api/msgs/send" id="msgs_add">
							<input type="hidden" id="friend" name="friend" value="${u.id}">
							 <div class="am-form-group">   
							      <textarea class="" id="tngou_msg" rows="3"  name="msg"   placeholder="有什么聊的？你来说说吧！"></textarea>   
							    </div>
							   <footer class="am-comment-footer " >
							  <button type="submit" class="am-btn am-btn-success am-radius am-btn-sm  btn-loading-example"    > 发 送 </button>
							    
							  </footer>
							</form>							
					<script type="text/javascript">
					    var loading; 
					   $('#msgs_add').ajaxForm({
						    beforeSubmit: function(a,f,o) {
						        loading=weui.loading('数据加载中...');
						    },
						    success: function(json) {	    	
						    	if(json.status)
						    	{
						    	  	if(loading)loading.hide();
						    		weui.toast(json.msg); 	  			
						    		location.href="";	
						    		  		
						    	}else
						    	{	
						    		if(loading)loading.hide();
						    	    weui.alert(json.msg);  		 
						    	}
						    }
						});
						</script>
							
							
							</div>
							</div>
							</div>
							</section>
							 
							 	
							 <div class="am-comments-list">
						
						<#list page.list as item>
							  <article class="am-comment <#if user.id==item.sender> am-comment-flip </#if>" >
							  
							  <img src="${Domain}${freemarker.avatar(item.avatar)}" alt="" class="am-comment-avatar" height="48" width="48">
							 
							  <div class="am-comment-main">
							  <div class="am-comment-hd"><div class="am-comment-meta">
							  ${item.name} 发送于 <time datetime="${item.time}" title="${item.time}">${freemarker.prettytime(item.time)}</time>
							  </div>
							  <div class="am-comment-actions"><a href="javascript:deleteItem(${item.id})" title="删除"><i class="am-icon-close"></i></a>
							  </div>
							  </div>						  
							  <div class="am-comment-bd">
							  <p>${item.msg}</p>
							 
							  </div>
							  </article>
							</#list>
	  
							
							  	<#include "../common/page.ftl">	
							  </div>
							</div>
                          	
                            
                            </div>
                        </div>
                    </div>
                </div>
            </div> 
 </div>   

	

<!-- 结束评论框 -->


 <script type="text/javascript">
 var loading;
 function deleteItem(id)
 {
 	weui.confirm('是否删除该数据?', 
 	function(){ 
 	   loading =weui.loading('数据删除中...');
 		$.getJSON("${Domain}api/msgs/delete", { id: id }, function(json){
		  if(json.status)
		  {
		     if(loading) loading.hide();
	    	 weui.toast(json.msg);
	    	 location.href="";	
		  }else
	    	{	
	    		if(loading) loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
		});
 	  },
    function(){ console.log('no') });
 }
 </script>      
<#include "footer.ftl">